<template>
	<view>
		<view class="search">
			<u-search :showAction="true" @search="search" @custom="search" v-model="queryParams.params.title" placeholder="请输入标题"></u-search>
		</view>
				
		<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="loadMore">
			
			<view class="cu-list menu-avatar">
				<view v-for="(item, index) in list" :key="index" @click="navTo(item.userId)">
					<view class="order">
						<view class="top">
							<view class="left">
								<uni-text class="cuIcon-titles text-blue"></uni-text>
								<view class="store">{{ item.nickName }}</view>
							</view>
							<view class="right">
								<!-- <text class="text-blue">进度：</text>
								<view class="progressBox">
									<u-line-progress :percent="item.progre" :active-color="activeColor"
									:striped="true" :stripedActive="true"></u-line-progress>
								</view> -->
							</view>
						</view>
						<view class="item">
							<view class="left">
								<!-- <image :src="item.url" mode="aspectFill"></image> -->
							</view>
							<view class="content">
								<view class="title u-line-2 text-bold">{{ item.userName }}</view>
								<view class="type">备注：{{ item.remark }}</view>
								<view class="delivery-time">电话： {{ item.phonenumber }}</view>
							</view>
						</view>
						<u-line color="#f1f1f1" margin="24rpx 0 15rpx 0"></u-line>
						<view class="bottom">
							<view>
								<view class="cu-avatar-group" style="padding-left: 40rpx;">
									<view class="cu-avatar round" :style="[{ backgroundImage:'url(' + baseFileUrl + item.avatar + ')' }]"></view>
								</view>
								<text class="text-blue text-shadow">{{item.createTime}}</text>
							</view>
							
							<view class="btnBox">
								<!-- <view @click="goClass" class="evaluate btn">班级信息</view> -->
							</view>
						</view>
					</view>
				</view>												
			</view>
			
			<!-- 加载更多 -->
			<u-loadmore :status="loadStatus" marginTop="20" marginBottom="20" @loadmore="loadMore" />
			
		</scroll-view>

		<drag-button :isDock="true" :existTabBar="true" @btnClick="navTo" >
			<u-icon name="plus-circle-fill" size="50" color="#3d87ff"></u-icon>
		</drag-button>
	</view>
</template>
<script>
import { listMixin } from "@/mixins/list"	
import dragButton from '@/components/drag-button/drag-button';

export default {
	mixins: [ listMixin ],
	components: { dragButton },
	data() {
		return {
			//查询参数
			queryParams: {
			  //第几页
			  pageNum: 1,
			  //一页几行
			  pageSize: 10,
			  //条件
			  params: {
				  status: "0",
				  auditby: null,
				  title: ""
			  }
			}
		};
	},
	methods: {
		//调用list接口
		callList(queryParams) {
			let _this = this;
			return new Promise(function(resolve, reject) {
				_this.$u.api.user.list(queryParams).then((res) => {			
					resolve(res);
				}).catch((error) => {
					reject(error)
				});			
			});  
		},
		navTo(id) {
			uni.navigateTo({
				url: "/pages/system/user/edit?id=" + id
			});
		}
	}
};

</script>
<style lang="scss">
	@import '@/static/scss/index.scss';	
</style>
